﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IQueryable<Mvc2.Models.DataRecord>>" %>

<asp:Content ID="indexTitle" ContentPlaceHolderID="TitleContent" runat="server">
    Home Page
</asp:Content>
<asp:Content ID="indexContent" ContentPlaceHolderID="MainContent" runat="server">
    <%: Html.ActionLink<EvTestController>("EV", c => c.Index()) %>
    <% 
        var filter = this.ViewContext.GetService<EvenOddFilter>(true);
        using (Html.BeginFilterForm(filter, null))
        { %>
    <%: Html.DropDownList(filter.GetStateParameterName(s => s.Mode), filter.GetModeList(), new { onchange = "javascript:this.form.submit();" }  ) %>
    <% } %>
    <%= Html.ActionLink<HomeController>("Export to excel", c => c.ExportToExcel()) %>
    <% var dataRec = new DataRecord(); %>
    <table>
        <tr>
            <td colspan="4">
                <% Html.RenderPartial("PagerControl"); %>
            </td>
        </tr>
        <tr>
            <td colspan="4">
                <% Html.RenderPartial("Alphabet"); %>
            </td>
        </tr>
        <tr>
            <td>
                <%= Html.LabelFor(m => dataRec.Id)%>
            </td>
            <td>
                <%= Html.LabelFor(m => dataRec.Field1)%>
            </td>
            <td>
                <%= Html.LabelFor(m => dataRec.Field2)%>
            </td>
            <td>
                <%= Html.LabelFor(m => dataRec.Field3)%>
            </td>
        </tr>
        <% foreach (var dataRecord in Model)
           { %>
        <tr>
            <td>
                <%= Html.DisplayFor(m => dataRecord.Id)%>
            </td>
            <td>
                <%= Html.DisplayFor(m => dataRecord.Field1)%>
            </td>
            <td>
                <%= Html.DisplayFor(m => dataRecord.Field2)%>
            </td>
            <td>
                <%= Html.DisplayFor(m => dataRecord.Field3)%>
            </td>
        </tr>
        <% } %>
        <tr>
            <td colspan="4">
                <% Html.RenderPartial("PagerControl"); %>
            </td>
        </tr>
    </table>
</asp:Content>
